home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update32.zoo / libg++ / tests / diffs
Encoding:
Text File  |  1993-07-13  |  12.9 KB  |  618 lines

  1. *** 1.7    1992/12/28 07:31:22
  2. --- PatchLev.h    1993/07/13 20:01:40
  3. ***************
  4. *** 1,5 ****
  5.   
  6. ! #define    PatchLevel "9"
  7.   
  8.   /*
  9.    *    the Patch Level above is to identify the version
  10. --- 1,5 ----
  11.   
  12. ! #define    PatchLevel "10"
  13.   
  14.   /*
  15.    *    the Patch Level above is to identify the version
  16. *** 1.4    1992/12/28 07:31:22
  17. --- expected.out    1993/07/13 20:01:41
  18. ***************
  19. *** 134,139 ****
  20. --- 134,140 ----
  21.   one = 1
  22.   one + 1 = 2
  23.   two = 2
  24. + twofiftysix = 256
  25.   fact30 = factorial(30) = 265252859812191058636308480000000
  26.   fact28 = factorial(28) = 304888344611713860501504000000
  27.   fact30 + fact28 = 265557748156802772496809984000000
  28. ***************
  29. *** 171,180 ****
  30. --- 172,185 ----
  31.   comps64 ^ s32 = 18446744069414584319
  32.   
  33.   enter an Integer: number = 12345678901234567890
  34. + 2^32 = 4294967296
  35. + 2^32 % (2^32-1) = 1
  36. + 2^32 % (2^32-1) = 1
  37.   
  38.   End of test
  39.   trationa
  40.   one = 1
  41. + two = 2
  42.   third = 1/3
  43.   half = 1/2
  44.   third + half = 5/6
  45. ***************
  46. *** 446,452 ****
  47.   five samples:
  48.   10.4918 0.295112 0.184577 2.14799 0.10053 
  49.   Statistics for 100 samples:
  50. ! samples: 100 min: 2.36481e-04 max: 15.4934
  51.   mean: 1.96369 stdDev: 2.97642 var: 8.85906 confidence(95): 0.59072
  52.   SampleHistogram for 100 Normal samples
  53.   < -4 : 0
  54. --- 451,457 ----
  55.   five samples:
  56.   10.4918 0.295112 0.184577 2.14799 0.10053 
  57.   Statistics for 100 samples:
  58. ! samples: 100 min: 0.000236481 max: 15.4934
  59.   mean: 1.96369 stdDev: 2.97642 var: 8.85906 confidence(95): 0.59072
  60.   SampleHistogram for 100 Normal samples
  61.   < -4 : 0
  62. ***************
  63. *** 454,460 ****
  64.   < -2.4 : 0
  65.   < -1.6 : 7
  66.   < -0.8 : 15
  67. ! < 6.66134e-16 : 36
  68.   < 0.8 : 15
  69.   < 1.6 : 19
  70.   < 2.4 : 7
  71. --- 459,465 ----
  72.   < -2.4 : 0
  73.   < -1.6 : 7
  74.   < -0.8 : 15
  75. ! < -2.22045e-16 : 36
  76.   < 0.8 : 15
  77.   < 1.6 : 19
  78.   < 2.4 : 7
  79. ***************
  80. *** 647,652 ****
  81. --- 652,658 ----
  82.   1.1 = 1
  83.   .7 + .5 = -0.8
  84.   -.5 - .7 = 0.8
  85. + tillist
  86.   prepending...
  87.   a: 9 8 7 6 5 4 3 2 1 0 
  88.   appending...
  89. *** 1.4    1992/12/28 07:31:22
  90. --- makefile.32    1993/07/13 20:01:41
  91. ***************
  92. *** 42,50 ****
  93. --- 42,54 ----
  94.   tfix24.ttp tgetopt.ttp tinteger.ttp tobstack.ttp trandom.ttp trationa.ttp \
  95.   tstring.ttp tillist.ttp
  96.   
  97. + OBJS = $(TEST:.ttp=.o)
  98.   # the stuff to make
  99.   ALL= $(TEST)
  100.   
  101. + objects: $(OBJS)
  102. + obj: $(OBJS)
  103.   # g++ files should have extension .cc
  104.   # generated test files will habe .ttp extn
  105.   
  106. *** 1.1    1992/03/22 21:15:45
  107. --- tbitset.cc    1993/07/13 20:01:41
  108. ***************
  109. *** 51,57 ****
  110.     assert(x.OK());
  111.   }
  112.   
  113. ! main()
  114.   {
  115.     cout << "BitSet tests:\n";
  116.   
  117. --- 51,57 ----
  118.     assert(x.OK());
  119.   }
  120.   
  121. ! int main()
  122.   {
  123.     cout << "BitSet tests:\n";
  124.   
  125. ***************
  126. *** 184,190 ****
  127.     cout << "\n";
  128.   
  129.     cout << "clear bits in g (reverse order):\n";
  130. !   for (p = g.last(0); p >= 0; p = g.previous(p, 0))
  131.     {
  132.       assert(g[p] == 0);
  133.       cout << p << " ";
  134. --- 184,190 ----
  135.     cout << "\n";
  136.   
  137.     cout << "clear bits in g (reverse order):\n";
  138. !   for (p = g.last(0); p >= 0; p = g.prev(p, 0))
  139.     {
  140.       assert(g[p] == 0);
  141.       cout << p << " ";
  142. ***************
  143. *** 201,205 ****
  144. --- 201,206 ----
  145.     assert(h.OK());
  146.   
  147.     cout << "\nEnd of test.\n";
  148. +   return 0;
  149.   }
  150.   
  151. *** 1.1    1992/03/22 21:15:45
  152. --- tbitstri.cc    1993/07/13 20:01:42
  153. ***************
  154. *** 177,183 ****
  155.     cout << "k.right_trim(1)      : " << k << "\n";
  156.   }
  157.   
  158. ! main()
  159.   {
  160.     BitString a;
  161.     BitString b = atoBitString("1000000001");
  162. --- 177,183 ----
  163.     cout << "k.right_trim(1)      : " << k << "\n";
  164.   }
  165.   
  166. ! int main()
  167.   {
  168.     BitString a;
  169.     BitString b = atoBitString("1000000001");
  170. ***************
  171. *** 234,240 ****
  172.     cout << "\n";
  173.   
  174.     cout << "clear bits in g (reverse order):\n";
  175. !   for (p = g.last(0); p >= 0; p = g.previous(p, 0)) 
  176.     {
  177.       assert(g[p] == 0);
  178.       cout << p << " ";
  179. --- 234,240 ----
  180.     cout << "\n";
  181.   
  182.     cout << "clear bits in g (reverse order):\n";
  183. !   for (p = g.last(0); p >= 0; p = g.prev(p, 0)) 
  184.     {
  185.       assert(g[p] == 0);
  186.       cout << p << " ";
  187. ***************
  188. *** 317,323 ****
  189.     subtest(d);
  190.   
  191.     cout << "\nEnd of test.\n";
  192.   }
  193.   
  194.   
  195. --- 317,323 ----
  196.     subtest(d);
  197.   
  198.     cout << "\nEnd of test.\n";
  199. !   return 0;
  200.   }
  201.   
  202.   
  203. *** 1.1    1992/03/22 21:15:45
  204. --- tcomplex.cc    1993/07/13 20:01:42
  205. ***************
  206. *** 129,132 ****
  207. --- 129,133 ----
  208.     cout << "number = " << c << "\n";
  209.   
  210.     cout << "\nEnd of test\n";
  211. +   return 0;
  212.   }
  213. *** 1.1    1992/03/22 21:15:45
  214. --- tfile.cc    1993/07/13 20:01:43
  215. ***************
  216. *** 83,88 ****
  217. --- 83,89 ----
  218.     cout << "rest   = " << s << "\n";
  219.   
  220.     assert(cin.good());
  221.     assert(cout.good());
  222.   
  223.   }
  224. ***************
  225. *** 367,370 ****
  226. --- 368,372 ----
  227.     cout << "cerr:     " << "(stderr)" << "\t" << cerr.rdstate() << "\n";
  228.   #endif
  229.     cout << "\nend of test.\n";
  230. +   return 0;
  231.   }
  232. *** 1.1    1992/03/22 21:15:45
  233. --- tfile.inp    1993/07/13 20:01:43
  234. ***************
  235. *** 2,4 ****
  236. --- 2,5 ----
  237.   123 4567 89012
  238.   123.456 -1.2e-2
  239.   1 2 3 4 5
  240. + abcdefghijklmnop
  241. *** 1.1    1992/03/22 21:15:45
  242. --- tfix.cc    1993/07/13 20:01:43
  243. ***************
  244. *** 4,35 ****
  245.   
  246.   #include <xfix.h>
  247.   
  248. ! overload check;
  249. ! overload checkb;
  250.   
  251. ! void check(const char* x, Fix y)
  252. ! {
  253. !   cout << x << " = " << (y) << "\n";
  254. ! }
  255.   
  256. ! void check(const char* x, int y)
  257. ! {
  258. !   cout << x << " = " << (y) << "\n";
  259. ! }
  260.   
  261. ! void check(const char* x, double y)
  262. ! {
  263. !   cout << x << " = " << (y) << "\n";
  264. ! }
  265.   
  266. ! void checkb(const char* x, Fix y)
  267.   {
  268.     cout << x << " = " << (y) << " [" << length(y) << "]"<< "\n";
  269.   }
  270.   
  271.   
  272.   
  273. ! main() {
  274.     cout << "Fix: identities should be displayed\n"
  275.       << "[X] displays the precision of a given value\n"
  276.       << "[*] indicates that the full precision is not used for coding reasons\n";
  277. --- 4,25 ----
  278.   
  279.   #include <xfix.h>
  280.   
  281. ! void check(const char* x, Fix y) { cout << x << " = " << (y) << "\n"; }
  282.   
  283. ! void check(const char* x, int y) { cout << x << " = " << (y) << "\n"; }
  284.   
  285. ! void check(const char* x, long y) { cout << x << " = " << (y) << "\n"; }
  286.   
  287. ! void check(const char* x, double y) { cout << x << " = " << (y) << "\n"; }
  288.   
  289. ! void checkb(const char* x, const Fix y)
  290.   {
  291.     cout << x << " = " << (y) << " [" << length(y) << "]"<< "\n";
  292.   }
  293.   
  294.   
  295.   
  296. ! int main() {
  297.     cout << "Fix: identities should be displayed\n"
  298.       << "[X] displays the precision of a given value\n"
  299.       << "[*] indicates that the full precision is not used for coding reasons\n";
  300. ***************
  301. *** 55,61 ****
  302.     check(".1 [33] <= -.2 [17]",d <= c);
  303.   
  304.     e = .5;
  305. !   check("1073741824",mantissa(e));
  306.     check(".5",value(e));
  307.   
  308.     checkb(".5 [17]",+e);
  309. --- 45,51 ----
  310.     check(".1 [33] <= -.2 [17]",d <= c);
  311.   
  312.     e = .5;
  313. !   check("1073741824",mantissa(e).as_double());
  314.     check(".5",value(e));
  315.   
  316.     checkb(".5 [17]",+e);
  317. ***************
  318. *** 106,109 ****
  319. --- 96,101 ----
  320.     checkb(".95 [16] + .1 [33]",g+d);
  321.     checkb("-.1 [33] - .95 [16]",-d-g);
  322.     checkb(".5 [17] * 2",e*2);
  323. +   return 0;
  324.   }
  325. *** 1.1    1992/03/22 21:15:45
  326. --- tfix16.cc    1993/07/13 20:01:43
  327. ***************
  328. *** 8,13 ****
  329. --- 8,14 ----
  330.   // of evaluating y to happen before x is printed.
  331.   
  332.   inline void check(char *x, int y) { cout << x << " = " << (y) << "\n"; }
  333. + inline void check(char *x, long y) { cout << x << " = " << (y) << "\n"; }
  334.   inline void check(char *x, double y) { cout << x << " = " << (y) << "\n"; }
  335.   inline void check(char *x, Fix16 y) { cout << x << " = " << (y) << "\n"; }
  336.   inline void check(char *x, Fix32 y) { cout << x << " = " << (y) << "\n"; }
  337. ***************
  338. *** 102,109 ****
  339.     check(".5 / .1",b/d);
  340.   }
  341.   
  342. ! main() {
  343.     test16();
  344.     test32();
  345.   }
  346. --- 103,110 ----
  347.     check(".5 / .1",b/d);
  348.   }
  349.   
  350. ! int main() {
  351.     test16();
  352.     test32();
  353. +   return 0;
  354.   }
  355. *** 1.1    1992/03/22 21:15:45
  356. --- tfix24.cc    1993/07/13 20:01:44
  357. ***************
  358. *** 8,13 ****
  359. --- 8,15 ----
  360.   // of evaluating y to happen before x is printed.
  361.   
  362.   inline void check(char *x, int y) { cout << x << " = " << (y) << "\n"; }
  363. + inline void check(char *x, long y) { cout << x << " = " << (y) << "\n"; }
  364. + inline void check(char *x, unsigned long y) { cout << x << " = " << (y) << "\n"; }
  365.   inline void check(char *x, double y) { cout << x << " = " << (y) << "\n"; }
  366.   inline void check(char *x, Fix24 y) { cout << x << " = " << (y) << "\n"; }
  367.   inline void check(char *x, Fix48 y) { cout << x << " = " << (y) << "\n"; }
  368. ***************
  369. *** 102,109 ****
  370.     check("-.5 - .7",c-g);
  371.   }
  372.   
  373. ! main() {
  374.     test24();
  375.     test48();
  376.   }
  377.   
  378. --- 104,112 ----
  379.     check("-.5 - .7",c-g);
  380.   }
  381.   
  382. ! int main() {
  383.     test24();
  384.     test48();
  385. +   return 0;
  386.   }
  387.   
  388. *** 1.1    1992/12/28 07:31:22
  389. --- tillist.cc    1993/07/13 20:01:44
  390. ***************
  391. *** 19,25 ****
  392.   #define tassert(ex) {if ((ex)) cerr << #ex << "\n"; \
  393.                          else _assert(#ex, __FILE__,__LINE__); }
  394.   
  395. ! #include <stream.h>
  396.   #include <xsllist.h>
  397.   #include <xdllist.h>
  398.   
  399. --- 19,25 ----
  400.   #define tassert(ex) {if ((ex)) cerr << #ex << "\n"; \
  401.                          else _assert(#ex, __FILE__,__LINE__); }
  402.   
  403. ! #include <iostream.h>
  404.   #include <xsllist.h>
  405.   #include <xdllist.h>
  406.   
  407. *** 1.2    1992/12/28 07:31:22
  408. --- tinteger.cc    1993/07/13 20:01:45
  409. ***************
  410. *** 393,399 ****
  411.     cout << "2^32 % (2^32-1) = " << b << "\n"; // but b is ok
  412.   }
  413.   
  414. ! main()
  415.   {
  416.     Integer one = 1;
  417.     cout << "one = " << one << "\n";
  418. --- 393,399 ----
  419.     cout << "2^32 % (2^32-1) = " << b << "\n"; // but b is ok
  420.   }
  421.   
  422. ! int main()
  423.   {
  424.     Integer one = 1;
  425.     cout << "one = " << one << "\n";
  426. ***************
  427. *** 406,411 ****
  428. --- 406,417 ----
  429.     assert(two.OK());
  430.     assert(two == 2);
  431.   
  432. + /* inbox/1782 */
  433. +   Integer n (0);
  434. +   setbit (n, 8);
  435. +   clearbit (n, 16);
  436. +   cout << "twofiftysix = " << n << '\n';
  437.     facttest(one, two);
  438.     fibtest();
  439.     anothertest();
  440. ***************
  441. *** 413,416 ****
  442. --- 419,423 ----
  443.     modtest();
  444.   
  445.     cout << "\nEnd of test\n";
  446. +   return 0;
  447.   }
  448. *** 1.2    1992/12/28 07:31:22
  449. --- tobstack.cc    1993/07/13 20:01:45
  450. ***************
  451. *** 17,22 ****
  452. --- 17,23 ----
  453.   #include <stddef.h>
  454.   #include <ctype.h>
  455.   
  456. + int
  457.   main()
  458.   {
  459.     char*   s[10000];
  460. ***************
  461. *** 77,81 ****
  462.   
  463.     cout << "\nend of test\n";
  464.   
  465.   }
  466. --- 78,82 ----
  467.   
  468.     cout << "\nend of test\n";
  469.   
  470. +   return 0;
  471.   }
  472. *** 1.1    1992/03/22 21:15:45
  473. --- trandom.cc    1993/07/13 20:01:45
  474. ***************
  475. *** 99,102 ****
  476. --- 99,103 ----
  477.       h += r6();
  478.     h.printBuckets(cout);
  479.     cout << "\nEnd of test\n";
  480. +   return 0;
  481.   }
  482. *** 1.2    1992/07/21 14:47:55
  483. --- trationa.cc    1993/07/13 20:01:46
  484. ***************
  485. *** 58,64 ****
  486. --- 58,70 ----
  487.     Rational half(1, 2);
  488.     assert(half.OK());
  489.   
  490. +   Rational two(2);
  491. +   Rational zero(0);
  492. +   Rational r;
  493. +   r = two+zero;
  494.     cout << "one = " << one << "\n";
  495. +   cout << "two = " << r << "\n";
  496.     cout << "third = " << third << "\n";
  497.     cout << "half = " << half << "\n";
  498.   
  499. ***************
  500. *** 125,132 ****
  501. --- 131,140 ----
  502.     assert(!(approxpi == rpi));
  503.     assert(!(approxpi <= rpi));
  504.     assert(!(approxpi < rpi));
  505. + #ifdef __GNUC__
  506.     assert((approxpi >? rpi) == approxpi);
  507.     assert((approxpi <? rpi) == rpi);
  508. + #endif
  509.   
  510.     assert(floor(approxpi) == 3);
  511.     assert(ceil(approxpi) == 4);
  512. ***************
  513. *** 173,179 ****
  514.     cout << "approxe = " << approxe << "\n";
  515.   }
  516.   
  517. ! main()
  518.   {
  519.     simpletest();
  520.     pitest();
  521. --- 181,187 ----
  522.     cout << "approxe = " << approxe << "\n";
  523.   }
  524.   
  525. ! int main()
  526.   {
  527.     simpletest();
  528.     pitest();
  529. ***************
  530. *** 182,185 ****
  531. --- 190,194 ----
  532.     etest(100);
  533.     etest(1000);
  534.     cout << "\nEnd of test\n";
  535. +   return 0;
  536.   }
  537. *** 1.2    1992/05/29 15:07:55
  538. --- tstring.cc    1993/07/13 20:01:46
  539. ***************
  540. *** 5,10 ****
  541. --- 5,11 ----
  542.   */
  543.   
  544.   #include <xstring.h>
  545. + #include <stream.h>  // see note below on `dec(20)' about why this will go away
  546.   #include <std.h>
  547.   #include <assert.h>
  548.   
  549. ***************
  550. *** 57,62 ****
  551. --- 58,67 ----
  552.     assert(z.OK());
  553.     assert(z == "@");
  554.   
  555. +   // XXX: `dec' is obsolete.  Since String.h includes iostream.h, and not
  556. +   //      stream.h, we include stream.h in this file for the time being.  This
  557. +   //      test will be rewritten to be done the "right" way, but for now, let's
  558. +   //      save some time and go the easy route.
  559.     String n = dec(20);
  560.     cout << "A string initialized to dec(20):" << n << "\n";
  561.     assert(n.OK());
  562. ***************
  563. *** 323,329 ****
  564.     assert(w[2] == "has");
  565.     assert(w[3] == "five");
  566.     assert(w[4] == "words");
  567. !   assert(w[5] == 0);
  568.   
  569.     z = join(w, nw, "/");
  570.     cout << "z = join(w, nw, /); z =" << z << "\n";
  571. --- 328,334 ----
  572.     assert(w[2] == "has");
  573.     assert(w[3] == "five");
  574.     assert(w[4] == "words");
  575. !   assert(w[5] == (char*)0);
  576.   
  577.     z = join(w, nw, "/");
  578.     cout << "z = join(w, nw, /); z =" << z << "\n";
  579. ***************
  580. *** 391,397 ****
  581.     assert(x.freq(y) == 1);    // SubString
  582.   }
  583.   
  584. ! main()
  585.   {
  586.     decltest();
  587.     cattest();
  588. --- 396,402 ----
  589.     assert(x.freq(y) == 1);    // SubString
  590.   }
  591.   
  592. ! int main()
  593.   {
  594.     decltest();
  595.     cattest();
  596. ***************
  597. *** 405,410 ****
  598.     identitytest(X+Y+N+X+Y+N, "A string that will be used in identitytest but is otherwise just another useless string.");
  599.     iotest();
  600.     cout << "\nEnd of test\n";
  601.   }
  602. --- 410,414 ----
  603.     identitytest(X+Y+N+X+Y+N, "A string that will be used in identitytest but is otherwise just another useless string.");
  604.     iotest();
  605.     cout << "\nEnd of test\n";
  606. +   return 0;
  607.   }
  608.